package me.chinaq.fastweb.enums;

/**
 * 状态响应码
 * Created by shaoqi on 2016/7/4.
 */
public enum StatusCode {
	//成功
	SUCCESS(1000, "操作成功", "请求成功之后给予的提示"),
	//失败
	FAILED(2000, "系统繁忙", "默认错误提示"),
	/**
	 * 没有权限
	 */
	FAILED_PERMISSION(2001, "登录过期，请重新登录", "默认错误提示"),
	//路径问题
	FAILED_PATH(3000, "无效的接口地址", "调用的接口地址不存在"),
	//参数问题
	FAILED_ARGUMENT(3001, "缺少参数", "调用接口时传递的参数与要求不符"),
	FAILED_ARGUMENT_MATCH(3002, "无效参数", "调用接口时传递的参数与要求不符"),
	//参数问题
	FAILED_ARGUMENT_READ(3003, "解析参数失败", "可能传递了非法的数据格式"),
	//请求方式错误，比如POST接口，用GET方式请求。
	FAILED_REQUEST_MODE(3100, "请求方式错误", "比如POST接口，用GET方式请求"),
	//sql问题
	FAILED_DAO(4000, "系统繁忙", "执行sql语句没有成功");

	private final int code;
	private final String label;
	private final String remark;

	StatusCode(int code, String label, String remark) {
		this.code = code;
		this.label = label;
		this.remark = remark;
	}

	public int getCode() {
		return code;
	}

	public String getLabel() {
		return label;
	}
}
